/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Hashtable;
import java.util.Map;

/**
 * <p>Project: jse2302 - HashTableDemo
 * <p>Powered by webrx On 2023-06-26 09:45:33
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class HashTableDemo {
    public static void main(String[] args) {
        //HashMap 非线程安全
        //Hashtable 线程安全
        Map<String,String> map = new Hashtable<>();
        map.put("bj","北京市");
        map.put("ha","河南");
        map.put("hn","湖南");
        System.out.println(map.size());
        System.out.println(map.containsKey("bj"));
        System.out.println(map.containsValue("北京市"));

        System.out.println(map);



    }
}
